<template>
  <div class="wscn-http403-container">
    <div class="wscn-http403">
      <div class="pic-403">
        <img
          class="pic-403__parent"
          src="../../assets/images/403.png"
          alt="403"
        />
        <img
          class="pic-403__child left"
          src="../../assets/images/400.png"
          alt="403"
        />
        <img
          class="pic-403__child mid"
          src="../../assets/images/400.png"
          alt="403"
        />
        <img
          class="pic-403__child right"
          src="../../assets/images/400.png"
          alt="403"
        />
      </div>
      <div class="message">
        <div class="message__oops">403错误!</div>
        <div class="message__headline">
          {{ message }}
        </div>
        <div class="message__info">
          请检查URL地址是否正确,并确定已经登录或点击返回。
        </div>
        <el-button @click="goBack" class="message__return"> 返回</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "403",
  data() {
    return {
      message: "无权访问！",
      timeOutId: null,
    };
  },
  methods: {
    goBack() {
      // if (this.timeOutId) {
      //   clearTimeout(this.timeOutId)
      //   this.timeOutId = null;
      // }
      this.$router.back();
    },
  },
  created() {
    //this.$message.warning("无权访问！5秒后将自动跳转！")
    // this.timeoutId = setTimeout(() => {
    //   this.$router.back();
    //   if (this.$route.path === '/403')
    //     this.$router.back();
    // }, 5000);
  },
};
</script>

<style scoped>
.wscn-http403-container {
  transform: translate(-50%, -50%);
  position: absolute;
  top: 50%;
  left: 50%;
}

.wscn-http403 {
  position: relative;
  width: 1200px;
  padding: 0 50px;
  overflow: hidden;
}

.wscn-http403 .pic-403 {
  position: relative;
  float: left;
  width: 600px;
  overflow: hidden;
}

.wscn-http403 .pic-403__parent {
  width: 100%;
}

.wscn-http403 .pic-403__child {
  position: absolute;
}

.wscn-http403 .pic-403__child.left {
  width: 80px;
  top: 17px;
  left: 220px;
  opacity: 0;
  animation-name: birdLeft;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-delay: 1s;
}

.wscn-http403 .pic-403__child.mid {
  width: 46px;
  top: 10px;
  left: 420px;
  opacity: 0;
  animation-name: birdMid;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-delay: 1.2s;
}

.wscn-http403 .pic-403__child.right {
  width: 62px;
  top: 100px;
  left: 500px;
  opacity: 0;
  animation-name: birdRight;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-delay: 1s;
}

@keyframes birdLeft {
  0% {
    top: 17px;
    left: 220px;
    opacity: 0;
  }
  20% {
    top: 33px;
    left: 188px;
    opacity: 1;
  }
  80% {
    top: 81px;
    left: 92px;
    opacity: 1;
  }
  100% {
    top: 97px;
    left: 60px;
    opacity: 0;
  }
}

@keyframes birdMid {
  0% {
    top: 10px;
    left: 420px;
    opacity: 0;
  }
  20% {
    top: 40px;
    left: 360px;
    opacity: 1;
  }
  70% {
    top: 130px;
    left: 180px;
    opacity: 1;
  }
  100% {
    top: 160px;
    left: 120px;
    opacity: 0;
  }
}

@keyframes birdRight {
  0% {
    top: 100px;
    left: 500px;
    opacity: 0;
  }
  20% {
    top: 120px;
    left: 460px;
    opacity: 1;
  }
  80% {
    top: 180px;
    left: 340px;
    opacity: 1;
  }
  100% {
    top: 200px;
    left: 300px;
    opacity: 0;
  }
}

.wscn-http403 .message {
  position: relative;
  float: left;
  width: 300px;
  top: 50px;
  padding: 30px 0;
  overflow: hidden;
}

.wscn-http403 .message__oops {
  font-size: 32px;
  font-weight: bold;
  line-height: 40px;
  color: #1482f0;
  opacity: 0;
  margin-bottom: 20px;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

.wscn-http403 .message__headline {
  font-size: 20px;
  line-height: 24px;
  color: #222;
  font-weight: bold;
  opacity: 0;
  margin-bottom: 10px;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-delay: 0.1s;
  animation-fill-mode: forwards;
}

.wscn-http403 .message__info {
  font-size: 13px;
  line-height: 21px;
  color: grey;
  opacity: 0;
  margin-bottom: 30px;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-delay: 0.2s;
  animation-fill-mode: forwards;
}

.wscn-http403 .message__return {
  display: block;
  float: left;
  width: 110px;
  height: 36px;
  background: #1482f0;
  border-radius: 100px;
  text-align: center;
  color: #ffffff;
  opacity: 0;
  font-size: 14px;
  cursor: pointer;
  animation-name: slideUp;
  animation-duration: 0.5s;
  animation-delay: 0.3s;
  animation-fill-mode: forwards;
}

@keyframes slideUp {
  0% {
    transform: translateY(60px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
</style>
